import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';

import 'common/index.dart';
import 'global.dart';

void main() async {
  // 初始化全局服务和配置
  await Global.init();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: const Size(414, 896),
      child: MaterialApp.router(
        debugShowCheckedModeBanner: false,
        theme: ThemeData(fontFamily: 'Arial'),

        // go_router 配置
        routerConfig: appRouter,

        // SmartDialog配置
        builder: FlutterSmartDialog.init(),
      ),
    );
  }
}
